import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    isLogin:true,
    username:"测试用户",
    user_id:1,
    head_src:'https://i.postimg.cc/tgZNrkmn/image.jpg',
    blog_id: '' || localStorage.blog_id,
  },
  getters: {
  },
  mutations: {
    changeid(state,num){
      state.blog_id=num;
      localStorage.blog_id=num;
    }
  },
  actions: {
    change_id(context,num){
      context.commit('changeid',num);
    }
  },
  modules: {
  }
})
